<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="../../v2/common/jspcommon.jsp"%>
<%@include file="../common/oldjscss.jsp"%>

<style type="text/css">
    .l-table-edit {font-size: 12px;margin: auto; width:90%; border-collapse:collapse;}
 	.l-table-edit td{ padding:4px;border:1px solid #336699;}
</style>
<div>
	<table  class="l-table-edit">
		<tr>
			<td >帐户名</td>
			<td >所有未读的信息数量</td>
			<td > 操作</td>
		</tr>
		<c:forEach items="${pageModel.list}" var="superSon">
		<tr>
			<td width=33%><a href="javascript:void(0);" onclick="cancleFamily('${superSon.identifier}','${superSon.family }')" >${superSon.nickname}</a></td>
			<td width=33%>${superSon.noReadMsg}</td>
			<td width=33%><a href="javascript:void(0);"onclick="removeSuperSon('${superSon.identifier}')">移除小号</a></td>
		</tr>
		</c:forEach>
	</table>
	<c:if test="${pageModel.totalRecord > 0}">
				<div id="pager" class="h_page"></div>
	</c:if>
</div>
<script type="text/javascript">
$(function(){
	$("#pager").pager({ pagenumber: ${pageModel.currentPage}, 
		pagecount: ${pageModel.totalPage},
		buttonClickCallback: function(page){
			$("#super_content").load("/misc/superUser/superUserList.htm?page="+page);
		}
	});
});

	function cancleFamily(member,family){
		
		$.post("/misc/superUser/cancleFamily.htm",{
			memberId:member
		}, function(data) {
			window.open ("/family?id="+family);
		});	
	}
	function removeSuperSon(memberId){
		
			$.get("/misc/user/isSuperSon.htm?userid="+memberId+"&isSon=false",function(data){
				if(data=="success"){
					alert("移除小号成功");
				}
			});
		
	}
</script>